<%@ page import="javax.servlet.*" %>
<%

String ipInfo = request.getRemoteAddr();
//test
ipInfo = "202.006.098.165";

//korea ip band
//211.032.000.000~211.051.255.255 한국
//210.216.000.000~210.223.255.255 한국
//210.204.000.000~210.207.255.255 한국
//210.178.000.000~210.184.095.255 한국
//210.090.000.000~210.127.255.255 한국
//202.014.103.000~202.014.103.255 한국
//202.006.095.000~202.006.095.255 한국

boolean ipCheck_KOR = ipInfo.startsWith("211.032") || ipInfo.startsWith("211.033") || ipInfo.startsWith("211.034") || ipInfo.startsWith("211.035")
					|| ipInfo.startsWith("211.036") || ipInfo.startsWith("211.037") || ipInfo.startsWith("211.038") || ipInfo.startsWith("211.039")
					|| ipInfo.startsWith("211.040") || ipInfo.startsWith("211.041") || ipInfo.startsWith("211.042") || ipInfo.startsWith("211.043")
					|| ipInfo.startsWith("211.044") || ipInfo.startsWith("211.045") || ipInfo.startsWith("211.046") || ipInfo.startsWith("211.047")
					|| ipInfo.startsWith("211.048") || ipInfo.startsWith("211.049") || ipInfo.startsWith("211.050") || ipInfo.startsWith("211.051")
					|| ipInfo.startsWith("210.216") || ipInfo.startsWith("210.217") || ipInfo.startsWith("210.218") || ipInfo.startsWith("210.219")
					|| ipInfo.startsWith("210.220") || ipInfo.startsWith("210.221") || ipInfo.startsWith("210.222") || ipInfo.startsWith("210.223")
					|| ipInfo.startsWith("210.204") || ipInfo.startsWith("210.205") || ipInfo.startsWith("210.206") || ipInfo.startsWith("210.207")
					|| ipInfo.startsWith("210.178") || ipInfo.startsWith("210.179") || ipInfo.startsWith("210.180") || ipInfo.startsWith("210.181")
					|| ipInfo.startsWith("210.182") || ipInfo.startsWith("210.183") || ipInfo.startsWith("210.184")
					|| ipInfo.startsWith("210.090") || ipInfo.startsWith("210.091") || ipInfo.startsWith("210.092") || ipInfo.startsWith("210.093")
					|| ipInfo.startsWith("210.094") || ipInfo.startsWith("210.095") || ipInfo.startsWith("210.096") || ipInfo.startsWith("210.097")
					|| ipInfo.startsWith("210.098") || ipInfo.startsWith("210.099") || ipInfo.startsWith("210.100") || ipInfo.startsWith("210.101")
					|| ipInfo.startsWith("210.102") || ipInfo.startsWith("210.103") || ipInfo.startsWith("210.104") || ipInfo.startsWith("210.105")
					|| ipInfo.startsWith("210.106") || ipInfo.startsWith("210.107") || ipInfo.startsWith("210.108") || ipInfo.startsWith("210.109")
					|| ipInfo.startsWith("210.110") || ipInfo.startsWith("210.111") || ipInfo.startsWith("210.112") || ipInfo.startsWith("210.113")
					|| ipInfo.startsWith("210.114") || ipInfo.startsWith("210.115") || ipInfo.startsWith("210.116") || ipInfo.startsWith("210.117")
					|| ipInfo.startsWith("210.118") || ipInfo.startsWith("210.119") || ipInfo.startsWith("210.120") || ipInfo.startsWith("210.121")
					|| ipInfo.startsWith("210.122") || ipInfo.startsWith("210.123") || ipInfo.startsWith("210.124") || ipInfo.startsWith("210.125")
					|| ipInfo.startsWith("210.126") || ipInfo.startsWith("210.127")
					|| ipInfo.startsWith("202.014.103")
					|| ipInfo.startsWith("202.006.095");

//japan ip band
//211.008.000.000~211.019.255.255 일본
//210.248.000.000~211.007.255.255 일본
//210.224.000.000~210.239.255.255 일본
//210.196.000.000~210.199.255.255 일본
//210.188.000.000~210.191.255.255 일본
//210.128.000.000~210.175.255.255 일본
//210.088.000.000~210.088.191.255 일본
//210.081.000.000~210.081.031.255 일본
//202.208.000.000~202.255.255.255 일본
//202.015.000.000~202.019.255.255 일본
//202.013.000.000~202.013.254.255 일본
//202.012.008.000~202.012.015.255 일본
//202.011.000.000~202.011.255.255 일본
//202.006.103.000~202.006.103.255 일본
//202.006.098.000~202.006.098.255 일본
//202.000.093.000~202.000.093.255 일본
//202.000.076.000~202.000.076.255 일본 
//202.000.072.000~202.000.073.255 일본 
//202.000.065.000~202.000.066.255 일본

boolean ipCheck_JAP = ipInfo.startsWith("211.008") || ipInfo.startsWith("211.009") || ipInfo.startsWith("211.010") || ipInfo.startsWith("211.011")
					|| ipInfo.startsWith("211.012") || ipInfo.startsWith("211.013") || ipInfo.startsWith("211.014") || ipInfo.startsWith("211.015")
					|| ipInfo.startsWith("211.016") || ipInfo.startsWith("211.017") || ipInfo.startsWith("211.018") || ipInfo.startsWith("211.019")
					|| ipInfo.startsWith("210.248") || ipInfo.startsWith("210.249") || ipInfo.startsWith("210.250") || ipInfo.startsWith("210.251")
					|| ipInfo.startsWith("210.252") || ipInfo.startsWith("210.253") || ipInfo.startsWith("210.254") || ipInfo.startsWith("210.255")
					|| ipInfo.startsWith("211.001") || ipInfo.startsWith("211.002") || ipInfo.startsWith("211.003") || ipInfo.startsWith("211.004")
					|| ipInfo.startsWith("211.005") || ipInfo.startsWith("211.006") || ipInfo.startsWith("211.007")
					|| ipInfo.startsWith("210.224") || ipInfo.startsWith("210.225") || ipInfo.startsWith("210.226") || ipInfo.startsWith("210.227")
					|| ipInfo.startsWith("210.228") || ipInfo.startsWith("210.229") || ipInfo.startsWith("210.230") || ipInfo.startsWith("210.231")
					|| ipInfo.startsWith("210.232") || ipInfo.startsWith("210.233") || ipInfo.startsWith("210.234") || ipInfo.startsWith("210.235")
					|| ipInfo.startsWith("210.236") || ipInfo.startsWith("210.237") || ipInfo.startsWith("210.238") || ipInfo.startsWith("210.239")
					|| ipInfo.startsWith("210.196") || ipInfo.startsWith("210.197") || ipInfo.startsWith("210.198") || ipInfo.startsWith("210.199")
					|| ipInfo.startsWith("210.188") || ipInfo.startsWith("210.197") || ipInfo.startsWith("210.198") || ipInfo.startsWith("210.199")
					|| ipInfo.startsWith("210.128") || ipInfo.startsWith("210.129") || ipInfo.startsWith("210.130") || ipInfo.startsWith("210.131")
					|| ipInfo.startsWith("210.132") || ipInfo.startsWith("210.133") || ipInfo.startsWith("210.134") || ipInfo.startsWith("210.135")
					|| ipInfo.startsWith("210.136") || ipInfo.startsWith("210.137") || ipInfo.startsWith("210.138") || ipInfo.startsWith("210.139")
					|| ipInfo.startsWith("210.140") || ipInfo.startsWith("210.141") || ipInfo.startsWith("210.142") || ipInfo.startsWith("210.143")
					|| ipInfo.startsWith("210.144") || ipInfo.startsWith("210.145") || ipInfo.startsWith("210.146") || ipInfo.startsWith("210.147")
					|| ipInfo.startsWith("210.148") || ipInfo.startsWith("210.149") || ipInfo.startsWith("210.150") || ipInfo.startsWith("210.151")
					|| ipInfo.startsWith("210.152") || ipInfo.startsWith("210.153") || ipInfo.startsWith("210.154") || ipInfo.startsWith("210.155")
					|| ipInfo.startsWith("210.156") || ipInfo.startsWith("210.157") || ipInfo.startsWith("210.158") || ipInfo.startsWith("210.159")
					|| ipInfo.startsWith("210.160") || ipInfo.startsWith("210.161") || ipInfo.startsWith("210.162") || ipInfo.startsWith("210.163")
					|| ipInfo.startsWith("210.164") || ipInfo.startsWith("210.165") || ipInfo.startsWith("210.166") || ipInfo.startsWith("210.167")
					|| ipInfo.startsWith("210.168") || ipInfo.startsWith("210.169") || ipInfo.startsWith("210.170") || ipInfo.startsWith("210.171")
					|| ipInfo.startsWith("210.172") || ipInfo.startsWith("210.173") || ipInfo.startsWith("210.174") || ipInfo.startsWith("210.175")
					|| ipInfo.startsWith("210.088")
					|| ipInfo.startsWith("210.081")
					|| ipInfo.startsWith("202.208") || ipInfo.startsWith("202.209") || ipInfo.startsWith("202.210") || ipInfo.startsWith("202.211")
					|| ipInfo.startsWith("202.212") || ipInfo.startsWith("202.213") || ipInfo.startsWith("202.214") || ipInfo.startsWith("202.215")
					|| ipInfo.startsWith("202.216") || ipInfo.startsWith("202.217") || ipInfo.startsWith("202.218") || ipInfo.startsWith("202.219")
					|| ipInfo.startsWith("202.220") || ipInfo.startsWith("202.221") || ipInfo.startsWith("202.222") || ipInfo.startsWith("202.223")
					|| ipInfo.startsWith("202.224") || ipInfo.startsWith("202.225") || ipInfo.startsWith("202.226") || ipInfo.startsWith("202.227")
					|| ipInfo.startsWith("202.228") || ipInfo.startsWith("202.229") || ipInfo.startsWith("202.230") || ipInfo.startsWith("202.231")
					|| ipInfo.startsWith("202.232") || ipInfo.startsWith("202.233") || ipInfo.startsWith("202.234") || ipInfo.startsWith("202.235")
					|| ipInfo.startsWith("202.236") || ipInfo.startsWith("202.237") || ipInfo.startsWith("202.238") || ipInfo.startsWith("202.239")
					|| ipInfo.startsWith("202.240") || ipInfo.startsWith("202.241") || ipInfo.startsWith("202.242") || ipInfo.startsWith("202.243")
					|| ipInfo.startsWith("202.244") || ipInfo.startsWith("202.245") || ipInfo.startsWith("202.246") || ipInfo.startsWith("202.247")
					|| ipInfo.startsWith("202.248") || ipInfo.startsWith("202.249") || ipInfo.startsWith("202.250") || ipInfo.startsWith("202.251")
					|| ipInfo.startsWith("202.252") || ipInfo.startsWith("202.253") || ipInfo.startsWith("202.254") || ipInfo.startsWith("202.255")
					|| ipInfo.startsWith("202.015") || ipInfo.startsWith("202.016") || ipInfo.startsWith("202.017") || ipInfo.startsWith("202.018")
					|| ipInfo.startsWith("202.019")
					|| ipInfo.startsWith("202.013")
					|| ipInfo.startsWith("202.012.008") || ipInfo.startsWith("202.012.009") || ipInfo.startsWith("202.012.010") || ipInfo.startsWith("202.012.011")
					|| ipInfo.startsWith("202.012.012") || ipInfo.startsWith("202.012.013") || ipInfo.startsWith("202.012.014") || ipInfo.startsWith("202.012.015")
					|| ipInfo.startsWith("202.011")
					|| ipInfo.startsWith("202.000.065") || ipInfo.startsWith("202.000.072") || ipInfo.startsWith("202.000.073")
					|| ipInfo.startsWith("202.000.076") || ipInfo.startsWith("202.000.093") || ipInfo.startsWith("202.006.098")
					|| ipInfo.startsWith("202.006.103");

String countryCode = "";
if(ipCheck_KOR == true){
	countryCode = "ko";
}else if(ipCheck_JAP == true){
	countryCode = "jp";
}else{
	countryCode = "en";
}

//when you first access, set session values
session.setAttribute("countryIpInfo", countryCode);


%>
<html>
<head>
    <title>DreamPharos v0.1</title>    
</head>
<body>
	<div style="text-align:center; padding-top:200px; ">
    	<a href="main.dp?lang=<%=session.getAttribute("countryIpInfo")%>"><img src="/DP_Home/images/dp_logo_gate.png" /></a>
    	<br />
    	<span style="font-size:10px; color:#e4e4e4; ">v0.1</span>
	</div>
</body>
</html>